import requests

def delete_image(harbor_url, repo_name, project_name, image_name, username, password):
    url = f"{harbor_url}/api/repositories/{repo_name}/{project_name}/tags/{image_name}"
    response = requests.delete(url, auth=(username, password))
    return response.status_code

#  http://192.168.235.134:60195/api/repositories/demo/zookeeper/tags?detail=1

# harbor_url = "http://harbor.irissz.com:60195"
# project_id = "scmv6"
# repo_name = "your-repo-name"
# username = "your-username"
# password = "your-password"


# http://192.168.235.134:60195/api/repositories/demo/zookeeper/tags/3.9.5

harbor_url = "http://harbor.irissz.com:60195"
repo_name = "scmv6"
project_name = "center-merge"
username = "admin"
password = "iris@Harbor2020"
image_version = "7165ffb"

# 假设你有一个镜像摘要列表
digests = ["digest1", "digest2", "digest3"]

res2 = delete_image(harbor_url, repo_name, project_name, image_version, username, password)
print(res2)